<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: resource.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('resource_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">resource.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Generic resource handling.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;assert.h&gt;</code><br />
<code>#include &quot;<a class="el" href="uthash_8h_source.html">uthash.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="async_8h_source.html">async.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="str_8h_source.html">str.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pdu_8h_source.html">pdu.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="net_8h_source.html">net.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="subscribe_8h_source.html">subscribe.h</a>&quot;</code><br />
</div>
<p><a href="resource_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a8d07061a1bb4a55b64c517b5a0a02914" id="r_a8d07061a1bb4a55b64c517b5a0a02914"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a8d07061a1bb4a55b64c517b5a0a02914">COAP_RESOURCE_CHECK_TIME</a>&#160;&#160;&#160;2</td></tr>
<tr class="memdesc:a8d07061a1bb4a55b64c517b5a0a02914"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interval in seconds to check if resources have changed.  <br /></td></tr>
<tr class="separator:a8d07061a1bb4a55b64c517b5a0a02914"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2892686485c67ab0b946708ad59bcf51" id="r_a2892686485c67ab0b946708ad59bcf51"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a2892686485c67ab0b946708ad59bcf51">COAP_ATTR_FLAGS_RELEASE_NAME</a>&#160;&#160;&#160;0x1</td></tr>
<tr class="separator:a2892686485c67ab0b946708ad59bcf51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dfff2e71cc242377e92e0b322ddd1ea" id="r_a1dfff2e71cc242377e92e0b322ddd1ea"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a1dfff2e71cc242377e92e0b322ddd1ea">COAP_ATTR_FLAGS_RELEASE_VALUE</a>&#160;&#160;&#160;0x2</td></tr>
<tr class="separator:a1dfff2e71cc242377e92e0b322ddd1ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee71da70d15897c276b0c4166ad1eaa6" id="r_aee71da70d15897c276b0c4166ad1eaa6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#aee71da70d15897c276b0c4166ad1eaa6">COAP_RESOURCE_FLAGS_RELEASE_URI</a>&#160;&#160;&#160;0x1</td></tr>
<tr class="memdesc:aee71da70d15897c276b0c4166ad1eaa6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The URI passed to <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> is free'd by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a>.  <br /></td></tr>
<tr class="separator:aee71da70d15897c276b0c4166ad1eaa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e981058b430c857caaa44a6bd742cf3" id="r_a0e981058b430c857caaa44a6bd742cf3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0e981058b430c857caaa44a6bd742cf3">COAP_RESOURCE_FLAGS_NOTIFY_NON</a>&#160;&#160;&#160;0x0</td></tr>
<tr class="memdesc:a0e981058b430c857caaa44a6bd742cf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Notifications will be sent non-confirmable by default.  <br /></td></tr>
<tr class="separator:a0e981058b430c857caaa44a6bd742cf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70fae1b37775ebbf9984d9873b15c781" id="r_a70fae1b37775ebbf9984d9873b15c781"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a70fae1b37775ebbf9984d9873b15c781">COAP_RESOURCE_FLAGS_NOTIFY_CON</a>&#160;&#160;&#160;0x2</td></tr>
<tr class="memdesc:a70fae1b37775ebbf9984d9873b15c781"><td class="mdescLeft">&#160;</td><td class="mdescRight">Notifications will be sent confirmable by default.  <br /></td></tr>
<tr class="separator:a70fae1b37775ebbf9984d9873b15c781"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22f2db8593afab3bb8c153e2346fdf75" id="r_a22f2db8593afab3bb8c153e2346fdf75"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a22f2db8593afab3bb8c153e2346fdf75">COAP_PRINT_STATUS_MASK</a>&#160;&#160;&#160;0xF0000000u</td></tr>
<tr class="separator:a22f2db8593afab3bb8c153e2346fdf75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf2fbde3cc54e108713886d6e23040f0" id="r_acf2fbde3cc54e108713886d6e23040f0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#acf2fbde3cc54e108713886d6e23040f0">COAP_PRINT_OUTPUT_LENGTH</a>(v)&#160;&#160;&#160;((v) &amp; ~<a class="el" href="resource_8h.html#a22f2db8593afab3bb8c153e2346fdf75">COAP_PRINT_STATUS_MASK</a>)</td></tr>
<tr class="separator:acf2fbde3cc54e108713886d6e23040f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abba955fb8180d86085c2f0680626cfe8" id="r_abba955fb8180d86085c2f0680626cfe8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#abba955fb8180d86085c2f0680626cfe8">COAP_PRINT_STATUS_ERROR</a>&#160;&#160;&#160;0x80000000u</td></tr>
<tr class="separator:abba955fb8180d86085c2f0680626cfe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a457e1894c102b193d1d59de022035ac9" id="r_a457e1894c102b193d1d59de022035ac9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a457e1894c102b193d1d59de022035ac9">COAP_PRINT_STATUS_TRUNC</a>&#160;&#160;&#160;0x40000000u</td></tr>
<tr class="separator:a457e1894c102b193d1d59de022035ac9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15958c8e0206576186380e783bca59f3" id="r_a15958c8e0206576186380e783bca59f3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a15958c8e0206576186380e783bca59f3">RESOURCES_ADD</a>(r,  obj)&#160;&#160;&#160;  <a class="el" href="uthash_8h.html#aaf01358e257c8d838eb5e4b189f0c399">HASH_ADD</a>(hh, (r), uri_path-&gt;s[0], (obj)-&gt;uri_path-&gt;length, (obj))</td></tr>
<tr class="separator:a15958c8e0206576186380e783bca59f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3a9ffcab8f22609f9786d0b63098009" id="r_af3a9ffcab8f22609f9786d0b63098009"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#af3a9ffcab8f22609f9786d0b63098009">RESOURCES_DELETE</a>(r,  obj)&#160;&#160;&#160;  <a class="el" href="uthash_8h.html#a3f83117e1108d63844a58d2d79c3b980">HASH_DELETE</a>(hh, (r), (obj))</td></tr>
<tr class="separator:af3a9ffcab8f22609f9786d0b63098009"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbf6d1376ab4eec0d503f47281877f4c" id="r_afbf6d1376ab4eec0d503f47281877f4c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#afbf6d1376ab4eec0d503f47281877f4c">RESOURCES_ITER</a>(r,  tmp)</td></tr>
<tr class="separator:afbf6d1376ab4eec0d503f47281877f4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a922414123af335d7015cc68ca1cfc765" id="r_a922414123af335d7015cc68ca1cfc765"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a922414123af335d7015cc68ca1cfc765">RESOURCES_FIND</a>(r,  k,  res)</td></tr>
<tr class="separator:a922414123af335d7015cc68ca1cfc765"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a0e546da5428d06e7bd64308f3e0434af" id="r_a0e546da5428d06e7bd64308f3e0434af"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a>) (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *, struct <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *, <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *, <a class="el" href="structcoap__string__t.html">coap_string_t</a> *, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *)</td></tr>
<tr class="memdesc:a0e546da5428d06e7bd64308f3e0434af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of message handler function (.  <br /></td></tr>
<tr class="separator:a0e546da5428d06e7bd64308f3e0434af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82fb5abc4a6f18544f5942a0ec5e69cf" id="r_a82fb5abc4a6f18544f5942a0ec5e69cf"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structcoap__attr__t.html">coap_attr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a82fb5abc4a6f18544f5942a0ec5e69cf">coap_attr_t</a></td></tr>
<tr class="separator:a82fb5abc4a6f18544f5942a0ec5e69cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add40a165542aff0ed5c680e2483e739f" id="r_add40a165542aff0ed5c680e2483e739f"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structcoap__resource__t.html">coap_resource_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#add40a165542aff0ed5c680e2483e739f">coap_resource_t</a></td></tr>
<tr class="separator:add40a165542aff0ed5c680e2483e739f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91b02fe05f44f053f50c8d07b03f1f6e" id="r_a91b02fe05f44f053f50c8d07b03f1f6e"><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a></td></tr>
<tr class="memdesc:a91b02fe05f44f053f50c8d07b03f1f6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Status word to encode the result of conditional print or copy operations such as <a class="el" href="resource_8h.html#a1ee72943df541ed5d4294c13e967ef09" title="Writes a description of this resource in link-format to given text buffer.">coap_print_link()</a>.  <br /></td></tr>
<tr class="separator:a91b02fe05f44f053f50c8d07b03f1f6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9edd43fc111e854367ef646a21bd93b1" id="r_a9edd43fc111e854367ef646a21bd93b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1">coap_resource_init</a> (<a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *uri_path, int flags)</td></tr>
<tr class="memdesc:a9edd43fc111e854367ef646a21bd93b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new resource object and initializes the link field to the string <code>uri_path</code>.  <br /></td></tr>
<tr class="separator:a9edd43fc111e854367ef646a21bd93b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af892e2c08f144561327b11b65396d5cc" id="r_af892e2c08f144561327b11b65396d5cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#af892e2c08f144561327b11b65396d5cc">coap_resource_unknown_init</a> (<a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a> put_handler)</td></tr>
<tr class="memdesc:af892e2c08f144561327b11b65396d5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new resource object for the unknown resource handler with support for PUT.  <br /></td></tr>
<tr class="separator:af892e2c08f144561327b11b65396d5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a73353dbd2bea291376334f3be3391e" id="r_a2a73353dbd2bea291376334f3be3391e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a2a73353dbd2bea291376334f3be3391e">coap_resource_set_mode</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, int mode)</td></tr>
<tr class="memdesc:a2a73353dbd2bea291376334f3be3391e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the notification message type of resource <code>resource</code> to given <code>mode</code>.  <br /></td></tr>
<tr class="separator:a2a73353dbd2bea291376334f3be3391e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4341a249c1f00cf521bcd6432c7c7dc7" id="r_a4341a249c1f00cf521bcd6432c7c7dc7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a4341a249c1f00cf521bcd6432c7c7dc7">coap_resource_set_userdata</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r, void *data)</td></tr>
<tr class="memdesc:a4341a249c1f00cf521bcd6432c7c7dc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the user_data.  <br /></td></tr>
<tr class="separator:a4341a249c1f00cf521bcd6432c7c7dc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a243221fa3851a767e021574fbabc8758" id="r_a243221fa3851a767e021574fbabc8758"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a243221fa3851a767e021574fbabc8758">coap_resource_get_userdata</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r)</td></tr>
<tr class="memdesc:a243221fa3851a767e021574fbabc8758"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the user_data.  <br /></td></tr>
<tr class="separator:a243221fa3851a767e021574fbabc8758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a5f0705912b0a35a3d5764e86b94004" id="r_a9a5f0705912b0a35a3d5764e86b94004"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a9a5f0705912b0a35a3d5764e86b94004">coap_add_resource</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="memdesc:a9a5f0705912b0a35a3d5764e86b94004"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the given <code>resource</code> for <code>context</code>.  <br /></td></tr>
<tr class="separator:a9a5f0705912b0a35a3d5764e86b94004"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3521b724ad4961e6bb11801fd82a3e3" id="r_ad3521b724ad4961e6bb11801fd82a3e3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3">coap_delete_resource</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="memdesc:ad3521b724ad4961e6bb11801fd82a3e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a resource identified by <code>resource</code>.  <br /></td></tr>
<tr class="separator:ad3521b724ad4961e6bb11801fd82a3e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fae3046ad94fce85a7ea23455328958" id="r_a1fae3046ad94fce85a7ea23455328958"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a1fae3046ad94fce85a7ea23455328958">coap_delete_all_resources</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a1fae3046ad94fce85a7ea23455328958"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes all resources from given <code>context</code> and frees their storage.  <br /></td></tr>
<tr class="separator:a1fae3046ad94fce85a7ea23455328958"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1787fba8c0b0cb7823fb251177c84fcd" id="r_a1787fba8c0b0cb7823fb251177c84fcd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a1787fba8c0b0cb7823fb251177c84fcd">coap_add_attr</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *name, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *value, int flags)</td></tr>
<tr class="memdesc:a1787fba8c0b0cb7823fb251177c84fcd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a new attribute with the given <code>resource</code>.  <br /></td></tr>
<tr class="separator:a1787fba8c0b0cb7823fb251177c84fcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adda0a00000cfd2cd898f1d5d074c921f" id="r_adda0a00000cfd2cd898f1d5d074c921f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#adda0a00000cfd2cd898f1d5d074c921f">coap_find_attr</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *name)</td></tr>
<tr class="memdesc:adda0a00000cfd2cd898f1d5d074c921f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>resource's</code> <a class="el" href="structcoap__attr__t.html">coap_attr_t</a> object with given <code>name</code> if found, <code>NULL</code> otherwise.  <br /></td></tr>
<tr class="separator:adda0a00000cfd2cd898f1d5d074c921f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37883d9c8bafdd59fd1bd57dcb82e908" id="r_a37883d9c8bafdd59fd1bd57dcb82e908"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a37883d9c8bafdd59fd1bd57dcb82e908">coap_delete_attr</a> (<a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *attr)</td></tr>
<tr class="memdesc:a37883d9c8bafdd59fd1bd57dcb82e908"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an attribute.  <br /></td></tr>
<tr class="separator:a37883d9c8bafdd59fd1bd57dcb82e908"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ee72943df541ed5d4294c13e967ef09" id="r_a1ee72943df541ed5d4294c13e967ef09"><td class="memItemLeft" align="right" valign="top"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a1ee72943df541ed5d4294c13e967ef09">coap_print_link</a> (const <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, unsigned char *buf, size_t *len, size_t *offset)</td></tr>
<tr class="memdesc:a1ee72943df541ed5d4294c13e967ef09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a description of this resource in link-format to given text buffer.  <br /></td></tr>
<tr class="separator:a1ee72943df541ed5d4294c13e967ef09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3e125d7975a649b6ac818c8bfb87baa" id="r_af3e125d7975a649b6ac818c8bfb87baa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#af3e125d7975a649b6ac818c8bfb87baa">coap_register_handler</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, unsigned char method, <a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a> handler)</td></tr>
<tr class="memdesc:af3e125d7975a649b6ac818c8bfb87baa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the specified <code>handler</code> as message handler for the request type <code>method</code>.  <br /></td></tr>
<tr class="separator:af3e125d7975a649b6ac818c8bfb87baa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247f7d06524ccbad44273ae9cdfecad" id="r_a3247f7d06524ccbad44273ae9cdfecad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a3247f7d06524ccbad44273ae9cdfecad">coap_get_resource_from_uri_path</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *uri_path)</td></tr>
<tr class="memdesc:a3247f7d06524ccbad44273ae9cdfecad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the resource identified by the unique string <code>uri_path</code>.  <br /></td></tr>
<tr class="separator:a3247f7d06524ccbad44273ae9cdfecad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa04a51c7660283d48f60bf899fe5c45b" id="r_aa04a51c7660283d48f60bf899fe5c45b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#aa04a51c7660283d48f60bf899fe5c45b">coap_add_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token, <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query, int has_block2, <a class="el" href="structcoap__block__t.html">coap_block_t</a> block2)</td></tr>
<tr class="memdesc:aa04a51c7660283d48f60bf899fe5c45b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the specified peer as observer for <code>resource</code>.  <br /></td></tr>
<tr class="separator:aa04a51c7660283d48f60bf899fe5c45b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6d585115f3bfa62c5e9d6129009c6c7" id="r_ad6d585115f3bfa62c5e9d6129009c6c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#ad6d585115f3bfa62c5e9d6129009c6c7">coap_find_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:ad6d585115f3bfa62c5e9d6129009c6c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a subscription object for given <code>peer</code>.  <br /></td></tr>
<tr class="separator:ad6d585115f3bfa62c5e9d6129009c6c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5bbd78aad763b34f4c0905fcd7b7454" id="r_ad5bbd78aad763b34f4c0905fcd7b7454"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#ad5bbd78aad763b34f4c0905fcd7b7454">coap_touch_observer</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:ad5bbd78aad763b34f4c0905fcd7b7454"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks an observer as alive.  <br /></td></tr>
<tr class="separator:ad5bbd78aad763b34f4c0905fcd7b7454"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ea23a6e5f19c9081f282e0a7cc4452d" id="r_a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0ea23a6e5f19c9081f282e0a7cc4452d">coap_delete_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any subscription for <code>observer</code> from <code>resource</code> and releases the allocated storage.  <br /></td></tr>
<tr class="separator:a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5456a0b3cbb6c2191420632da0c54bbf" id="r_a5456a0b3cbb6c2191420632da0c54bbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a5456a0b3cbb6c2191420632da0c54bbf">coap_delete_observers</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session)</td></tr>
<tr class="memdesc:a5456a0b3cbb6c2191420632da0c54bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any subscription for <code>session</code> and releases the allocated storage.  <br /></td></tr>
<tr class="separator:a5456a0b3cbb6c2191420632da0c54bbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a579bcb559463d3a872831c18d8d9a1c1" id="r_a579bcb559463d3a872831c18d8d9a1c1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a579bcb559463d3a872831c18d8d9a1c1">coap_check_notify</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a579bcb559463d3a872831c18d8d9a1c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for all known resources, if they are dirty and notifies subscribed observers.  <br /></td></tr>
<tr class="separator:a579bcb559463d3a872831c18d8d9a1c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b2cba9f6c0af2c91707072ffc3a2237" id="r_a0b2cba9f6c0af2c91707072ffc3a2237"><td class="memItemLeft" align="right" valign="top"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0b2cba9f6c0af2c91707072ffc3a2237">coap_print_wellknown</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *, unsigned char *, size_t *, size_t, <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *)</td></tr>
<tr class="memdesc:a0b2cba9f6c0af2c91707072ffc3a2237"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints the names of all known resources to <code>buf</code>.  <br /></td></tr>
<tr class="separator:a0b2cba9f6c0af2c91707072ffc3a2237"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c22a4e7f94f568370b38084ba64bc44" id="r_a1c22a4e7f94f568370b38084ba64bc44"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a1c22a4e7f94f568370b38084ba64bc44">coap_handle_failed_notify</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *)</td></tr>
<tr class="separator:a1c22a4e7f94f568370b38084ba64bc44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a715acd300482ec8a3051639fd0413706" id="r_a715acd300482ec8a3051639fd0413706"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a715acd300482ec8a3051639fd0413706">coap_resource_set_get_observable</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, int mode)</td></tr>
<tr class="memdesc:a715acd300482ec8a3051639fd0413706"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set whether a <code>resource</code> is observable.  <br /></td></tr>
<tr class="separator:a715acd300482ec8a3051639fd0413706"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a053626d2f222a32cc96c4a3dd9902f" id="r_a0a053626d2f222a32cc96c4a3dd9902f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0a053626d2f222a32cc96c4a3dd9902f">coap_resource_notify_observers</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query)</td></tr>
<tr class="memdesc:a0a053626d2f222a32cc96c4a3dd9902f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate the sending of an Observe packet for all observers of <code>resource</code>, optionally matching <code>query</code> if not NULL.  <br /></td></tr>
<tr class="separator:a0a053626d2f222a32cc96c4a3dd9902f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96308292262c4f7e420f31fff40ad4b5" id="r_a96308292262c4f7e420f31fff40ad4b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a96308292262c4f7e420f31fff40ad4b5">coap_resource_get_uri_path</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="memdesc:a96308292262c4f7e420f31fff40ad4b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the UriPath from a <code>resource</code>.  <br /></td></tr>
<tr class="separator:a96308292262c4f7e420f31fff40ad4b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0098ca940dd37e7d7425b929d194ca46" id="r_a0098ca940dd37e7d7425b929d194ca46"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8h.html#a0098ca940dd37e7d7425b929d194ca46">coap_resource_set_dirty</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r, const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query)</td></tr>
<tr class="separator:a0098ca940dd37e7d7425b929d194ca46"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Generic resource handling. </p>

<p class="definition">Definition in file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a2892686485c67ab0b946708ad59bcf51" name="a2892686485c67ab0b946708ad59bcf51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2892686485c67ab0b946708ad59bcf51">&#9670;&#160;</a></span>COAP_ATTR_FLAGS_RELEASE_NAME</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_ATTR_FLAGS_RELEASE_NAME&#160;&#160;&#160;0x1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00044">44</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a1dfff2e71cc242377e92e0b322ddd1ea" name="a1dfff2e71cc242377e92e0b322ddd1ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1dfff2e71cc242377e92e0b322ddd1ea">&#9670;&#160;</a></span>COAP_ATTR_FLAGS_RELEASE_VALUE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_ATTR_FLAGS_RELEASE_VALUE&#160;&#160;&#160;0x2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00045">45</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="acf2fbde3cc54e108713886d6e23040f0" name="acf2fbde3cc54e108713886d6e23040f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf2fbde3cc54e108713886d6e23040f0">&#9670;&#160;</a></span>COAP_PRINT_OUTPUT_LENGTH</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_PRINT_OUTPUT_LENGTH</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">v</td><td>)</td>
          <td>&#160;&#160;&#160;((v) &amp; ~<a class="el" href="resource_8h.html#a22f2db8593afab3bb8c153e2346fdf75">COAP_PRINT_STATUS_MASK</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00314">314</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="abba955fb8180d86085c2f0680626cfe8" name="abba955fb8180d86085c2f0680626cfe8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abba955fb8180d86085c2f0680626cfe8">&#9670;&#160;</a></span>COAP_PRINT_STATUS_ERROR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_PRINT_STATUS_ERROR&#160;&#160;&#160;0x80000000u</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00315">315</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a22f2db8593afab3bb8c153e2346fdf75" name="a22f2db8593afab3bb8c153e2346fdf75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22f2db8593afab3bb8c153e2346fdf75">&#9670;&#160;</a></span>COAP_PRINT_STATUS_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_PRINT_STATUS_MASK&#160;&#160;&#160;0xF0000000u</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00313">313</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a457e1894c102b193d1d59de022035ac9" name="a457e1894c102b193d1d59de022035ac9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a457e1894c102b193d1d59de022035ac9">&#9670;&#160;</a></span>COAP_PRINT_STATUS_TRUNC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_PRINT_STATUS_TRUNC&#160;&#160;&#160;0x40000000u</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00316">316</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a8d07061a1bb4a55b64c517b5a0a02914" name="a8d07061a1bb4a55b64c517b5a0a02914"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d07061a1bb4a55b64c517b5a0a02914">&#9670;&#160;</a></span>COAP_RESOURCE_CHECK_TIME</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_RESOURCE_CHECK_TIME&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The interval in seconds to check if resources have changed. </p>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00022">22</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a70fae1b37775ebbf9984d9873b15c781" name="a70fae1b37775ebbf9984d9873b15c781"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70fae1b37775ebbf9984d9873b15c781">&#9670;&#160;</a></span>COAP_RESOURCE_FLAGS_NOTIFY_CON</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_RESOURCE_FLAGS_NOTIFY_CON&#160;&#160;&#160;0x2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Notifications will be sent confirmable by default. </p>
<p>RFC 7641 Section 4.5 <a href="https://tools.ietf.org/html/rfc7641#section-4.5">https://tools.ietf.org/html/rfc7641#section-4.5</a> </p>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00067">67</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a0e981058b430c857caaa44a6bd742cf3" name="a0e981058b430c857caaa44a6bd742cf3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e981058b430c857caaa44a6bd742cf3">&#9670;&#160;</a></span>COAP_RESOURCE_FLAGS_NOTIFY_NON</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_RESOURCE_FLAGS_NOTIFY_NON&#160;&#160;&#160;0x0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Notifications will be sent non-confirmable by default. </p>
<p>RFC 7641 Section 4.5 <a href="https://tools.ietf.org/html/rfc7641#section-4.5">https://tools.ietf.org/html/rfc7641#section-4.5</a> </p>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00061">61</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="aee71da70d15897c276b0c4166ad1eaa6" name="aee71da70d15897c276b0c4166ad1eaa6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee71da70d15897c276b0c4166ad1eaa6">&#9670;&#160;</a></span>COAP_RESOURCE_FLAGS_RELEASE_URI</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_RESOURCE_FLAGS_RELEASE_URI&#160;&#160;&#160;0x1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The URI passed to <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> is free'd by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a>. </p>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00055">55</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a15958c8e0206576186380e783bca59f3" name="a15958c8e0206576186380e783bca59f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15958c8e0206576186380e783bca59f3">&#9670;&#160;</a></span>RESOURCES_ADD</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RESOURCES_ADD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">obj&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  <a class="el" href="uthash_8h.html#aaf01358e257c8d838eb5e4b189f0c399">HASH_ADD</a>(hh, (r), uri_path-&gt;s[0], (obj)-&gt;uri_path-&gt;length, (obj))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00449">449</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="af3a9ffcab8f22609f9786d0b63098009" name="af3a9ffcab8f22609f9786d0b63098009"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3a9ffcab8f22609f9786d0b63098009">&#9670;&#160;</a></span>RESOURCES_DELETE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RESOURCES_DELETE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">obj&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  <a class="el" href="uthash_8h.html#a3f83117e1108d63844a58d2d79c3b980">HASH_DELETE</a>(hh, (r), (obj))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00452">452</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a922414123af335d7015cc68ca1cfc765" name="a922414123af335d7015cc68ca1cfc765"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a922414123af335d7015cc68ca1cfc765">&#9670;&#160;</a></span>RESOURCES_FIND</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RESOURCES_FIND</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">k, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">res&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    {                     \</div>
<div class="line">    HASH_FIND(hh, (r), (k)-&gt;s, (k)-&gt;length, (res)); \</div>
<div class="line">  }</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00459">459</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="afbf6d1376ab4eec0d503f47281877f4c" name="afbf6d1376ab4eec0d503f47281877f4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afbf6d1376ab4eec0d503f47281877f4c">&#9670;&#160;</a></span>RESOURCES_ITER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RESOURCES_ITER</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">tmp&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">  <a class="code hl_struct" href="structcoap__resource__t.html">coap_resource_t</a> *tmp, *rtmp; \</div>
<div class="line">  HASH_ITER(hh, (r), tmp, rtmp)</div>
<div class="ttc" id="astructcoap__resource__t_html"><div class="ttname"><a href="structcoap__resource__t.html">coap_resource_t</a></div><div class="ttdef"><b>Definition</b> <a href="resource_8h_source.html#l00069">resource.h:69</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00455">455</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a82fb5abc4a6f18544f5942a0ec5e69cf" name="a82fb5abc4a6f18544f5942a0ec5e69cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a82fb5abc4a6f18544f5942a0ec5e69cf">&#9670;&#160;</a></span>coap_attr_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structcoap__attr__t.html">coap_attr_t</a> <a class="el" href="structcoap__attr__t.html">coap_attr_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0e546da5428d06e7bd64308f3e0434af" name="a0e546da5428d06e7bd64308f3e0434af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e546da5428d06e7bd64308f3e0434af">&#9670;&#160;</a></span>coap_method_handler_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* coap_method_handler_t) (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *, struct <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *, <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *, <a class="el" href="structcoap__string__t.html">coap_string_t</a> *, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition of message handler function (. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structcoap__resource__t.html">coap_resource_t</a>). </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00035">35</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a91b02fe05f44f053f50c8d07b03f1f6e" name="a91b02fe05f44f053f50c8d07b03f1f6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91b02fe05f44f053f50c8d07b03f1f6e">&#9670;&#160;</a></span>coap_print_status_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef unsigned int <a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Status word to encode the result of conditional print or copy operations such as <a class="el" href="resource_8h.html#a1ee72943df541ed5d4294c13e967ef09" title="Writes a description of this resource in link-format to given text buffer.">coap_print_link()</a>. </p>
<p>The lower 28 bits of coap_print_status_t are used to encode the number of characters that has actually been printed, bits 28 to 31 encode the status. When COAP_PRINT_STATUS_ERROR is set, an error occurred during output. In this case, the other bits are undefined. COAP_PRINT_STATUS_TRUNC indicates that the output is truncated, i.e. the printing would have exceeded the current buffer. </p>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00311">311</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="add40a165542aff0ed5c680e2483e739f" name="add40a165542aff0ed5c680e2483e739f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add40a165542aff0ed5c680e2483e739f">&#9670;&#160;</a></span>coap_resource_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> <a class="el" href="structcoap__resource__t.html">coap_resource_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1787fba8c0b0cb7823fb251177c84fcd" name="a1787fba8c0b0cb7823fb251177c84fcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1787fba8c0b0cb7823fb251177c84fcd">&#9670;&#160;</a></span>coap_add_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> * coap_add_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a new attribute with the given <code>resource</code>. </p>
<p>As the attribute's coap_str_const_ fields will point to <code>name</code> and <code>value</code> the caller must ensure that these pointers are valid during the attribute's lifetime.</p>
<p>If the <code>name</code> and/or <code>value</code> string is going to be freed off at attribute removal time by the setting of COAP_ATTR_FLAGS_RELEASE_NAME or COAP_ATTR_FLAGS_RELEASE_VALUE in <code>flags</code>, then either the 's' variable of <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> has to point to constant text, or point to data within the allocated <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> parameter.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to register the attribute with. </td></tr>
    <tr><td class="paramname">name</td><td>The attribute's name as a string. </td></tr>
    <tr><td class="paramname">value</td><td>The attribute's value as a string or <code>NULL</code> if none. </td></tr>
    <tr><td class="paramname">flags</td><td>Flags for memory management (in particular release of memory). Possible values:<br  />
 COAP_ATTR_FLAGS_RELEASE_NAME If this flag is set, the name passed to coap_add_attr_release() is free'd when the attribute is deleted<br  />
 COAP_ATTR_FLAGS_RELEASE_VALUE If this flag is set, the value passed to coap_add_attr_release() is free'd when the attribute is deleted<br  />
 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new attribute or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00352">352</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="aa04a51c7660283d48f60bf899fe5c45b" name="aa04a51c7660283d48f60bf899fe5c45b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa04a51c7660283d48f60bf899fe5c45b">&#9670;&#160;</a></span>coap_add_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> * coap_add_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>has_block2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__block__t.html">coap_block_t</a>&#160;</td>
          <td class="paramname"><em>block2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds the specified peer as observer for <code>resource</code>. </p>
<p>The subscription is identified by the given <code>token</code>. This function returns the registered subscription information if the <code>observer</code> has been added, or <code>NULL</code> on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription. </td></tr>
    <tr><td class="paramname">query</td><td>The query string, if any. subscription will take ownership of the string. </td></tr>
    <tr><td class="paramname">has_block2</td><td>If Option Block2 defined. </td></tr>
    <tr><td class="paramname">block2</td><td>Contents of Block2 if Block 2 defined. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the added/updated subscription information or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00623">623</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a9a5f0705912b0a35a3d5764e86b94004" name="a9a5f0705912b0a35a3d5764e86b94004"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a5f0705912b0a35a3d5764e86b94004">&#9670;&#160;</a></span>coap_add_resource()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_add_resource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the given <code>resource</code> for <code>context</code>. </p>
<p>The resource must have been created by <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> or <a class="el" href="resource_8h.html#af892e2c08f144561327b11b65396d5cc" title="Creates a new resource object for the unknown resource handler with support for PUT.">coap_resource_unknown_init()</a>, the storage allocated for the resource will be released by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context to use. </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to store. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00452">452</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a579bcb559463d3a872831c18d8d9a1c1" name="a579bcb559463d3a872831c18d8d9a1c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a579bcb559463d3a872831c18d8d9a1c1">&#9670;&#160;</a></span>coap_check_notify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_check_notify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks for all known resources, if they are dirty and notifies subscribed observers. </p>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00869">869</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1fae3046ad94fce85a7ea23455328958" name="a1fae3046ad94fce85a7ea23455328958"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fae3046ad94fce85a7ea23455328958">&#9670;&#160;</a></span>coap_delete_all_resources()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_all_resources </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes all resources from given <code>context</code> and frees their storage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context with the resources to be deleted. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00494">494</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a37883d9c8bafdd59fd1bd57dcb82e908" name="a37883d9c8bafdd59fd1bd57dcb82e908"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37883d9c8bafdd59fd1bd57dcb82e908">&#9670;&#160;</a></span>coap_delete_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td>
          <td class="paramname"><em>attr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes an attribute. </p>
<p>Note: This is for internal use only, as it is not deleted from its chain.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attr</td><td>Pointer to a previously created attribute. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00406">406</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a0ea23a6e5f19c9081f282e0a7cc4452d" name="a0ea23a6e5f19c9081f282e0a7cc4452d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ea23a6e5f19c9081f282e0a7cc4452d">&#9670;&#160;</a></span>coap_delete_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_delete_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes any subscription for <code>observer</code> from <code>resource</code> and releases the allocated storage. </p>
<p>The result is <code>1</code> if an observation relationship with <code>observer</code> and <code>token</code> existed, <code>0</code> otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session. </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription or <code>NULL</code> for any token. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the observer has been deleted, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00703">703</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a5456a0b3cbb6c2191420632da0c54bbf" name="a5456a0b3cbb6c2191420632da0c54bbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5456a0b3cbb6c2191420632da0c54bbf">&#9670;&#160;</a></span>coap_delete_observers()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes any subscription for <code>session</code> and releases the allocated storage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00729">729</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad3521b724ad4961e6bb11801fd82a3e3" name="ad3521b724ad4961e6bb11801fd82a3e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3521b724ad4961e6bb11801fd82a3e3">&#9670;&#160;</a></span>coap_delete_resource()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_delete_resource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes a resource identified by <code>resource</code>. </p>
<p>The storage allocated for that resource is freed, and removed from the context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context where the resources are stored. </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to delete.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the resource was found (and destroyed), <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00474">474</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="adda0a00000cfd2cd898f1d5d074c921f" name="adda0a00000cfd2cd898f1d5d074c921f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adda0a00000cfd2cd898f1d5d074c921f">&#9670;&#160;</a></span>coap_find_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> * coap_find_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <code>resource's</code> <a class="el" href="structcoap__attr__t.html">coap_attr_t</a> object with given <code>name</code> if found, <code>NULL</code> otherwise. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to search for attribute <code>name</code>. </td></tr>
    <tr><td class="paramname">name</td><td>Name of the requested attribute as a string. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The first attribute with specified <code>name</code> or <code>NULL</code> if none was found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00389">389</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad6d585115f3bfa62c5e9d6129009c6c7" name="ad6d585115f3bfa62c5e9d6129009c6c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6d585115f3bfa62c5e9d6129009c6c7">&#9670;&#160;</a></span>coap_find_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> * coap_find_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a subscription object for given <code>peer</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription or <code>NULL</code> for any token. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A valid subscription if exists or <code>NULL</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00587">587</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a3247f7d06524ccbad44273ae9cdfecad" name="a3247f7d06524ccbad44273ae9cdfecad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3247f7d06524ccbad44273ae9cdfecad">&#9670;&#160;</a></span>coap_get_resource_from_uri_path()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_get_resource_from_uri_path </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>uri_path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the resource identified by the unique string <code>uri_path</code>. </p>
<p>If no resource was found, this function returns <code>NULL</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context to look for this resource. </td></tr>
    <tr><td class="paramname">uri_path</td><td>The unique string uri of the resource.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the resource or <code>NULL</code> if not found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00515">515</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1c22a4e7f94f568370b38084ba64bc44" name="a1c22a4e7f94f568370b38084ba64bc44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c22a4e7f94f568370b38084ba64bc44">&#9670;&#160;</a></span>coap_handle_failed_notify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_handle_failed_notify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00930">930</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1ee72943df541ed5d4294c13e967ef09" name="a1ee72943df541ed5d4294c13e967ef09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ee72943df541ed5d4294c13e967ef09">&#9670;&#160;</a></span>coap_print_link()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a> coap_print_link </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes a description of this resource in link-format to given text buffer. </p>
<p><code>len</code> must be initialized to the maximum length of <code>buf</code> and will be set to the number of characters actually written if successful. This function returns <code>1</code> on success or <code>0</code> on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to describe. </td></tr>
    <tr><td class="paramname">buf</td><td>The output buffer to write the description to. </td></tr>
    <tr><td class="paramname">len</td><td>Must be initialized to the length of <code>buf</code> and will be set to the length of the printed link description. </td></tr>
    <tr><td class="paramname">offset</td><td>The offset within the resource description where to start writing into <code>buf</code>. This is useful for dealing with the Block2 option. <code>offset</code> is updated during output as it is consumed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise, the lower 28 bits will indicate the number of characters that have actually been output into <code>buffer</code>. The flag COAP_PRINT_STATUS_TRUNC indicates that the output has been truncated. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00524">524</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a0b2cba9f6c0af2c91707072ffc3a2237" name="a0b2cba9f6c0af2c91707072ffc3a2237"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b2cba9f6c0af2c91707072ffc3a2237">&#9670;&#160;</a></span>coap_print_wellknown()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a> coap_print_wellknown </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>buflen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>query_filter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prints the names of all known resources to <code>buf</code>. </p>
<p>This function sets <code>buflen</code> to the number of bytes actually written and returns <code>1</code> on succes. On error, the value in <code>buflen</code> is undefined and the return value will be <code>0</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context with the resource map. </td></tr>
    <tr><td class="paramname">buf</td><td>The buffer to write the result. </td></tr>
    <tr><td class="paramname">buflen</td><td>Must be initialized to the maximum length of <code>buf</code> and will be set to the length of the well-known response on return. </td></tr>
    <tr><td class="paramname">offset</td><td>The offset in bytes where the output shall start and is shifted accordingly with the characters that have been processed. This parameter is used to support the block option. </td></tr>
    <tr><td class="paramname">query_filter</td><td>A filter query according to <a href="http://tools.ietf.org/html/draft-ietf-core-link-format-11#section-4.1">Link Format</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>COAP_PRINT_STATUS_ERROR on error. Otherwise, the lower 28 bits are set to the number of bytes that have actually been written to <code>buf</code>. COAP_PRINT_STATUS_TRUNC is set when the output has been truncated. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00169">169</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="af3e125d7975a649b6ac818c8bfb87baa" name="af3e125d7975a649b6ac818c8bfb87baa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3e125d7975a649b6ac818c8bfb87baa">&#9670;&#160;</a></span>coap_register_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_register_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a>&#160;</td>
          <td class="paramname"><em>handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the specified <code>handler</code> as message handler for the request type <code>method</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource for which the handler shall be registered. </td></tr>
    <tr><td class="paramname">method</td><td>The CoAP request method to handle. </td></tr>
    <tr><td class="paramname">handler</td><td>The handler to register with <code>resource</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00577">577</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a96308292262c4f7e420f31fff40ad4b5" name="a96308292262c4f7e420f31fff40ad4b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96308292262c4f7e420f31fff40ad4b5">&#9670;&#160;</a></span>coap_resource_get_uri_path()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> * coap_resource_get_uri_path </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the UriPath from a <code>resource</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The CoAP resource to check.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The UriPath if it exists or <code>NULL</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00511">511</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a243221fa3851a767e021574fbabc8758" name="a243221fa3851a767e021574fbabc8758"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a243221fa3851a767e021574fbabc8758">&#9670;&#160;</a></span>coap_resource_get_userdata()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void * coap_resource_get_userdata </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>r</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the user_data. </p>
<p>The user_data is exclusively used by the library-user and can be used as context in the handler functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>Resource to retrieve the user_darta from</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The user_data pointer </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00213">213</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a9edd43fc111e854367ef646a21bd93b1" name="a9edd43fc111e854367ef646a21bd93b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9edd43fc111e854367ef646a21bd93b1">&#9670;&#160;</a></span>coap_resource_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_resource_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>uri_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new resource object and initializes the link field to the string <code>uri_path</code>. </p>
<p>This function returns the new <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> object.</p>
<p>If the string is going to be freed off by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a> when COAP_RESOURCE_FLAGS_RELEASE_URI is set in <code>flags</code>, then either the 's' variable of <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> has to point to constant text, or point to data within the allocated <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> parameter.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uri_path</td><td>The string URI path of the new resource. </td></tr>
    <tr><td class="paramname">flags</td><td>Flags for memory management (in particular release of memory). Possible values:<br  />
 COAP_RESOURCE_FLAGS_RELEASE_URI If this flag is set, the URI passed to <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> is free'd by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a><br  />
 COAP_RESOURCE_FLAGS_NOTIFY_CON If this flag is set, coap-observe notifications will be sent confirmable by default.<br  />
 COAP_RESOURCE_FLAGS_NOTIFY_NON (default) If this flag is set, coap-observe notifications will be sent non-confirmable by default.<br  />
 If flags is set to 0 then the COAP_RESOURCE_FLAGS_NOTIFY_NON is considered.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new object or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00300">300</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a0a053626d2f222a32cc96c4a3dd9902f" name="a0a053626d2f222a32cc96c4a3dd9902f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a053626d2f222a32cc96c4a3dd9902f">&#9670;&#160;</a></span>coap_resource_notify_observers()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_resource_notify_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initiate the sending of an Observe packet for all observers of <code>resource</code>, optionally matching <code>query</code> if not NULL. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The CoAP resource to use. </td></tr>
    <tr><td class="paramname">query</td><td>The Query to match against or NULL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the Observe has been triggered, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00837">837</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a0098ca940dd37e7d7425b929d194ca46" name="a0098ca940dd37e7d7425b929d194ca46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0098ca940dd37e7d7425b929d194ca46">&#9670;&#160;</a></span>coap_resource_set_dirty()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> int coap_resource_set_dirty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000008">Deprecated:</a></b></dt><dd>use <a class="el" href="resource_8h.html#a0a053626d2f222a32cc96c4a3dd9902f" title="Initiate the sending of an Observe packet for all observers of resource, optionally matching query if...">coap_resource_notify_observers()</a> instead. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00832">832</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a715acd300482ec8a3051639fd0413706" name="a715acd300482ec8a3051639fd0413706"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a715acd300482ec8a3051639fd0413706">&#9670;&#160;</a></span>coap_resource_set_get_observable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_resource_set_get_observable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set whether a <code>resource</code> is observable. </p>
<p>If the resource is observable and the client has set the COAP_OPTION_OBSERVE in a request packet, then whenever the state of the resource changes (a call to coap_resource_trigger_observe()), an Observer response will get sent.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The CoAP resource to use. </td></tr>
    <tr><td class="paramname">mode</td><td><code>1</code> if Observable is to be set, <code>0</code> otherwise. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00486">486</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a2a73353dbd2bea291376334f3be3391e" name="a2a73353dbd2bea291376334f3be3391e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a73353dbd2bea291376334f3be3391e">&#9670;&#160;</a></span>coap_resource_set_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_resource_set_mode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the notification message type of resource <code>resource</code> to given <code>mode</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to update. </td></tr>
    <tr><td class="paramname">mode</td><td>Must be one of <code>COAP_RESOURCE_FLAGS_NOTIFY_NON</code> or <code>COAP_RESOURCE_FLAGS_NOTIFY_CON</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00185">185</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="a4341a249c1f00cf521bcd6432c7c7dc7" name="a4341a249c1f00cf521bcd6432c7c7dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4341a249c1f00cf521bcd6432c7c7dc7">&#9670;&#160;</a></span>coap_resource_set_userdata()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_resource_set_userdata </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the user_data. </p>
<p>The user_data is exclusively used by the library-user and can be used as context in the handler functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>Resource to attach the data to </td></tr>
    <tr><td class="paramname">data</td><td>Data to attach to the user_data field. This pointer is only used for storage, the data remains under user control </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8h_source.html#l00200">200</a> of file <a class="el" href="resource_8h_source.html">resource.h</a>.</p>

</div>
</div>
<a id="af892e2c08f144561327b11b65396d5cc" name="af892e2c08f144561327b11b65396d5cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af892e2c08f144561327b11b65396d5cc">&#9670;&#160;</a></span>coap_resource_unknown_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_resource_unknown_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a>&#160;</td>
          <td class="paramname"><em>put_handler</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new resource object for the unknown resource handler with support for PUT. </p>
<p>In the same way that additional handlers can be added to the resource created by <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> by using <a class="el" href="resource_8h.html#af3e125d7975a649b6ac818c8bfb87baa" title="Registers the specified handler as message handler for the request type method.">coap_register_handler()</a>, POST, GET, DELETE etc. handlers can be added to this resource. It is the responsibility of the application to manage the unknown resources by either creating new resources with <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> (which should have a DELETE handler specified for the resource removal) or by maintaining an active resource list.</p>
<p>Note: There can only be one unknown resource handler per context - attaching a new one overrides the previous definition.</p>
<p>Note: It is not possible to observe the unknown resource with a GET request</p><ul>
<li>a separate resource needs to be reated by the PUT (or POST) handler, and make that resource observable.</li>
</ul>
<p>This function returns the new <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">put_handler</td><td>The PUT handler to register with <code>resource</code> for unknown Uri-Path.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new object or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00334">334</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad5bbd78aad763b34f4c0905fcd7b7454" name="ad5bbd78aad763b34f4c0905fcd7b7454"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5bbd78aad763b34f4c0905fcd7b7454">&#9670;&#160;</a></span>coap_touch_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_touch_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Marks an observer as alive. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The corresponding token that has been used for the subscription. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00690">690</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="resource_8h.html">resource.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
